module.exports = {
  apps: [
    {
      name: 'Auth',
      script: 'dist/apps/auth/main.js',
      instances: 1,
      exec_mode: 'fork',
      env: {
        NODE_ENV: 'prod',
        PORT: 3005,
      },
      env_local: {
        NODE_ENV: 'local',
        PORT: 3005,
      },
      watch: false,
      log_date_format: 'YYYY-MM-DD HH:mm:ss',
      error_file: './logs/auth-error.log',
      out_file: './logs/auth-out.log',
      merge_logs: true,
      port: 3005,
      restart_delay: 2000,
      restart_max_retries: 3,
    },
    {
      name: 'Core',
      script: 'dist/apps/core/main.js',
      instances: 1,
      exec_mode: 'fork',
      env: {
        NODE_ENV: 'prod',
        PORT: 3001,
      },
      env_local: {
        NODE_ENV: 'local',
        PORT: 3001,
      },
      watch: false,
      log_date_format: 'YYYY-MM-DD HH:mm:ss',
      error_file: './logs/core-error.log',
      out_file: './logs/core-out.log',
      merge_logs: true,
      port: 3001,
      restart_delay: 5000,
      restart_max_retries: 3,
    },
    {
      name: 'Email',
      script: 'dist/apps/email/main.js',
      instances: 1,
      exec_mode: 'fork',
      env: {
        NODE_ENV: 'prod',
        PORT: 3006,
      },
      env_local: {
        NODE_ENV: 'local',
        PORT: 3006,
      },
      watch: false,
      log_date_format: 'YYYY-MM-DD HH:mm:ss',
      error_file: './logs/email-error.log',
      out_file: './logs/email-out.log',
      merge_logs: true,
      port: 3006,
      restart_delay: 5000,
      restart_max_retries: 3,
    },
    {
      name: 'Gateway',
      script: 'dist/apps/gateway/main.js',
      instances: 1,
      exec_mode: 'fork',
      env: {
        NODE_ENV: 'prod',
        PORT: 3000,
      },
      env_local: {
        NODE_ENV: 'local',
        PORT: 3000,
      },
      watch: false,
      log_date_format: 'YYYY-MM-DD HH:mm:ss',
      error_file: './logs/gateway-error.log',
      out_file: './logs/gateway-out.log',
      merge_logs: true,
      port: 3000,
      restart_delay: 5000,
      restart_max_retries: 3,
    },
  ],
}
